pub fn odd_fibnacci_sum(threshold: u32) -> u32 {
    if threshold <= 1 {
        return 0;
    }
    
    let mut sum = 2;
    let mut n1 = 1;
    let mut n2 = 2;
    while n2 < threshold {
        if n2 % 2 == 1 {
            sum += n2;
        }

        let tmp = n2;
        n2 = n1 + n2;
        n1 = tmp;
    }
    
    sum
}
